/**
 * Utils
 */

// to string operation
exports.toStr = function(obj) {
    if (!obj) { return obj; }

    var inner = '';
    for (var k in obj) {
        inner += '' + k + '=' + obj[k] + ',';
    }
    return inner;
};

// affect each element by fn
exports.fnEach = function(arr, fn) {
    if (typeof fn != 'function') { return arr; }
    for (var i = 0, len = arr.length; i < len; i++) {
        fn(arr[i]);
    }
};

